package main

import (
	"fmt"
)

//map 可以动态增长 key value，切片不行必须 append
func main() {
	var map1 map[string]string
	map1 = make(map[string]string) //使用map之前必须用make map的key value 是无序的 只要一个参数
	map1["NO.1"] = "宋江"
	map1["NO.2"] = "吴用"
	map1["NO.1"] = "晁盖"
	fmt.Println(map1)
	fmt.Printf("%p \n", &map1)
	var cities map[string]string = map[string]string{
		"no1": "上海", "no2": "北京", "no3": "香港",
	}
	fmt.Println(cities)

	var provinces map[int]string = make(map[int]string)
	provinces[3] = "江西"
	provinces[1] = "浙江"
	provinces[5] = "江苏"
	provinces[9] = "河南"
	fmt.Println(provinces)

	students := map[string]map[string]string{
		"no1": {"name": "黄斌", "sex": "男"},
		"no2": {"name": "噜噜", "sex": "男"},
		"no3": {"name": "陈娱", "sex": "女"},
	}
	fmt.Println(students)
	students["no1"]["name"] = "三杯蛙"
	fmt.Println(students)
}
